#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int N = 2e6 + 5;
const int M = 998244353;

ll p[N];

int n, k;


int main() {
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false), cin.tie(0);
    cin >> n >> k;
    p[0] = 1;
    for (int i = 1; i < N; i++) p[i] = (p[i - 1] * 2) % M;

    ll res = 0;
    for (int i = 1; i <= n; i++) {
        // 第i层有p[i]个点
        // 每个点有2种情况
        ll temp = 0;

        if (i + k <= n) temp += p[k];

        if (k >= 2) {
            int l = max(1, i + k - n), r = min(k - 1, n - i);
            temp = (temp + p[k - 2] * max(0, r - l + 1)) % M;
        }

        res = (res + temp * p[i]) % M;
    }

    cout << res << endl;
    return 0;
}